<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="urn:hl7-org:v3 ..\sdschemas\SDA.xsd">
    <#assign templateData={"title":"会诊记录", "code":"HSDC00.04", "templateId":"2.16.156.10011.2.1.1.19"}>
    <#include "fragment/header/headerEles.ftl">

    <recordTarget typeCode="RCT" contextControlCode="OP">
        <patientRole classCode="PAT">
            <id root="2.16.156.10011.1.2" extension="${docData.patientRole.id}"/>
            <patient classCode="PSN" determinerCode="INSTANCE">
                <#if docData.patientRole.patient.id??>
                    <id root="2.16.156.10011.1.3" extension="${docData.patientRole.patient.id}"/>
                </#if>
                <name>${docData.patientRole.patient.name}</name>
            </patient>
        </patientRole>
    </recordTarget>
    <#include "fragment/header/author.ftl">
    <#include "fragment/header/custodian.ftl">
    <legalAuthenticator>
        <time value="${docData.legalAuthenticator.time}"/>
        <signatureCode/>
        <assignedEntity>
            <id/>
            <assignedPerson>
                <name>${docData.legalAuthenticator.name}</name>
            </assignedPerson>
        </assignedEntity>
    </legalAuthenticator>
        <relatedDocument typeCode="RPLC">
            <parentDocument moodCode="EVN" classCode="DOCCLIN">
                <id root="2.16.156.10011.1.1.2" extension="D2011000000"/>
                <setId/>
                <versionNumber value="1"/>
            </parentDocument>
        </relatedDocument>
    <component>
        <structuredBody>
            <#if docData.huiZhenYY.HUIZHENYY??>
                <component>
                    <section>
                        <code code="DE06.00.039.00" codeSystem="2.16.156.10011.2.2.1" displayName="会诊原因"
                              codeSystemName="卫生信息数据元目录"/>
                        <text>${docData.huiZhenYY.HUIZHENYY}</text>
                    </section>
                </component>
            </#if>
            <component>
                <section>
                    <code code="DE06.00.038.00" codeSystem="2.16.156.10011.2.2.1" displayName="会诊意见"
                          codeSystemName="卫生信息数据元目录"/>
                    <text/>
                    <entry>
                        <observation moodCode="PRP" classCode="OBS">
                            <code />
                            <effectiveTime value="${docData.huiZhenYJ.HUIZHENRQ}"/>
                            <value xsi:type="ST">${docData.huiZhenYJ.HUIZHENYJ}</value>
                            <performer>
                                <assignedEntity>
                                    <id/>
                                    <assignedPerson>
                                        <name>${docData.huiZhenYJ.HUIZHENZJXM}</name>
                                    </assignedPerson>
                                    <representedOrganization>
                                        <name>${docData.huiZhenYJ.HUIZHENKSMC}</name>
                                        <asOrganizationPartOf>
                                            <wholeOrganization>
                                                <id root="2.16.156.10011.1.5"
                                                    extension="${docData.huiZhenYJ.YEWUJGDM}"/>
                                                <name>${docData.huiZhenYJ.YEWUJGMC}</name>
                                            </wholeOrganization>
                                        </asOrganizationPartOf>
                                    </representedOrganization>
                                </assignedEntity>
                            </performer>
                        </observation>
                    </entry>
                </section>
            </component>
        </structuredBody>
    </component>
</ClinicalDocument>